﻿Imports System

Namespace System.Workflow.Runtime
    Public Class WorkflowEnvironment
        ' Properties
        Public Shared ReadOnly Property WorkBatch As IWorkBatch
            Get
                Dim workBatch As IWorkBatch = ServiceEnvironment.WorkBatch
                If (workBatch Is Nothing) Then
                    Throw New InvalidOperationException(ExecutionStringManager.WorkBatchNotFound)
                End If
                Return workBatch
            End Get
        End Property

        Public Shared ReadOnly Property WorkflowInstanceId As Guid
            Get
                Dim workflowInstanceId As Guid = ServiceEnvironment.WorkflowInstanceId
                If (workflowInstanceId = Guid.Empty) Then
                    Throw New InvalidOperationException(ExecutionStringManager.InstanceIDNotFound)
                End If
                Return workflowInstanceId
            End Get
        End Property

    End Class
End Namespace

